package com.idroid.domain;

import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.overlay.OverlayItem;

public class HookableParkingArea extends OverlayItem {

	ParkingArea area;

	public HookableParkingArea(ParkingArea area, double lat, double lon) {
		super(area.getId() + "", area.getAreaName(), area.getAddress(),
				new GeoPoint((int) ((double) lat * (double) 1E6),
						(int) ((double) lon * (double) 1E6)));
		this.area = area;
	}

	public ParkingArea getArea() {
		return area;
	}

	public void setArea(ParkingArea area) {
		this.area = area;
	}

	public String getSymbol() {
		return "icon_p";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((area == null) ? 0 : area.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HookableParkingArea other = (HookableParkingArea) obj;
		if (area == null) {
			if (other.area != null)
				return false;
		} else if (!area.equals(other.area))
			return false;
		return true;
	}

}
